function diff = root_w_SA( x, ind, param, param_ini, aux)

    param.omega_0 = x;
    x0 = fzero(@ (x) model_shock_SA(x,param_ini.mean_x.*(1-param.shock).^(1./(1-param.alpha)),param, aux), log(param_ini.lambda), optimset('display','iter'));
    param.lambda = exp(x0);   
    param = model_SA( param,aux);
    
    if ind==1 
        diff = log(u_fun(param)/u_fun(param_ini).*param.lambda./param_ini.lambda.*(1-u_fun(param_ini))./(1-u_fun(param)))/log(mean_fun( aux.n, 'm', param)./mean_fun( aux.n, 'm', param_ini)) - param.mom_deudAPL;
    else
        diff = param;
    end
end